var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("SwitchNodeY"),
    i = t("fightManager"),
    s = t("fightViewRankItem"),
    c = cc._decorator,
    l = c.ccclass,
    u = c.property,
    p = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (
                (e.item = null), (e.list = null), (e.widget = null), (e.sy = null), (e.ssan = null), (e.isshou = !1), e
            );
        }
        return (
            n(e, t),
            (e.prototype.start = function () {
                this.widget.target = cc.Canvas.instance.node;
                for (var t = i.default.inst.所有人的分数和状态.value, e = 0; e < t.length; e++) {
                    var o = t[e],
                        n = cc.instantiate(this.item);
                    (n.active = !0), (n.parent = this.list), n.getComponent(s.default).set(e + 1, o);
                }
                i.default.inst.所有人的分数和状态.on(this, this.on所有人的分数和状态), this.onclick();
            }),
            (e.prototype.on所有人的分数和状态 = function () {
                var t = this;
                i.default.inst.所有人的分数和状态.value.forEach(function (e, o) {
                    t.list.children[o].getComponent(s.default).set(o + 1, e);
                });
            }),
            (e.prototype.onclick = function () {
                (this.isshou = !this.isshou),
                    this.isshou
                        ? ((this.widget.right = 0), (this.ssan.scaleY = -1))
                        : ((this.widget.right = -283), (this.ssan.scaleY = 1));
            }),
            (e.prototype.onDestroy = function () {
                i.default.inst && i.default.inst.所有人的分数和状态.off(this, this.on所有人的分数和状态);
            }),
            r([u(cc.Node)], e.prototype, "item", void 0),
            r([u(cc.Node)], e.prototype, "list", void 0),
            r([u(cc.Widget)], e.prototype, "widget", void 0),
            r([u(a.default)], e.prototype, "sy", void 0),
            r([u(cc.Node)], e.prototype, "ssan", void 0),
            (e = r([l], e))
        );
    })(cc.Component);
o.default = p;
